<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>登录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .login-container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 300px;
        }

        .login-container h1 {
            text-align: center;
            margin-bottom: 20px;
            color: #333;
        }

        .login-container label {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }

        .login-container input {
            width: calc(100% - 22px); /* Adjust width to account for padding and border */
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        .login-container button {
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            border: none;
            border-radius: 4px;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
        }

        .login-container button:hover {
            background-color: #0056b3;
        }

        .login-container .error, .login-container .logout {
            text-align: center;
            color: red;
            margin-top: 10px;
        }

        .login-container .logout {
            color: green;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h1>登录</h1>
    <form method="post" th:action="@{/login}">
        <div>
            <label for="username">用户名：</label>
            <input id="username" name="username" required type="text">
        </div>
        <div>
            <label for="password">密码：</label>
            <input id="password" name="password" required type="password">
        </div>
        <div>
            <button type="submit">登录</button>
        </div>
        <div class="error" th:if="${param.error}">
            <p>用户名或密码错误</p>
        </div>
        <div class="logout" th:if="${param.logout}">
            <p>您已成功登出</p>
        </div>
    </form>
</div>
</body>
</html>
